//
//  YunCenterViewController.swift
//  Wmsmobile
//
//  Created by wangshuning on 16/7/27.
//  Copyright © 2016年 hddden. All rights reserved.
//

import UIKit

import MMDrawerController

class YunCenterViewController: UINavigationController {

    var leftbutton: UIBarButtonItem?
    var shouldOpen: DrawerShouldOpen?
    
    //#MARK: – Lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        self.navigationBar.barTintColor = UIColor.hexStringToUIColor("#00acff")
        self.navigationBar.tintColor = UIColor.white
        self.navigationBar.titleTextAttributes = {[
            NSForegroundColorAttributeName: UIColor.white,
            NSFontAttributeName: UIFont(name: "Heiti SC", size: 19)!
            ]}()
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.leftbutton = UIBarButtonItem.init(image: UIImage.init(named: "左侧icon"), style: UIBarButtonItemStyle.plain, target: self, action: #selector(YunCenterViewController.changeControllers))
        self.visibleViewController?.navigationItem.leftBarButtonItem = leftbutton
    }
    
    override var preferredStatusBarStyle : UIStatusBarStyle {
        return UIStatusBarStyle.lightContent
    }
    
    //#MARK: – IBAtions
    func changeControllers(){
        self.mm_drawerController.toggle(MMDrawerSide.left, animated: true, completion: nil)
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
